package com.ajk.server.dao;
import java.util.List;

import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;

import com.ajk.server.model.TestConfig;
import com.ajk.server.dao.provider.TestConfigProvider;
import com.ajk.server.model.query.TestConfigQuery;
/**
 * 自动评审结果-配置  <br>
 * t_test_config <br>
 * v1.0 2016-08-26
 */
 public interface TestConfigMapper {
 	
 	/**
 	*根据id删除 自动评审结果-配置
 	*/
 	@Delete("delete from t_test_config where id=#{id}")
 	public Integer deleteById(Integer id);
 	
 	@Delete("delete from t_test_config where category_id=#{categoryId}")
 	public Integer deleteByCategoryId(Integer categoryId);
 	/**
 	* 批量新增 自动评审结果-配置
 	*/
 	@InsertProvider(method="batchInsert",type=TestConfigProvider.class)
	@Options(useGeneratedKeys=true,keyColumn="id",keyProperty="list[0].id")
 	public Integer batchInsert(List<? extends TestConfig> testConfigs);
 	
 	/**
 	* 新增 自动评审结果-配置
 	*/
 	@InsertProvider(method="insert",type=TestConfigProvider.class)
	@Options(useGeneratedKeys=true)
 	public Integer insert(TestConfig domain);
 
 	
 	/**
 	*更新 自动评审结果-配置
 	*/
 	@UpdateProvider(method="update",type=TestConfigProvider.class)
 	public Integer update(TestConfig domain);
 	
 	/**
 	*根据ID查询 自动评审结果-配置
 	*/
	@Select("select * from t_test_config where id=#{id}")
	public TestConfig findById(Integer id);
	
	/**
 	*通过query 查询 自动评审结果-配置
 	*/
 	@SelectProvider(method="findByQuery",type=TestConfigProvider.class)
 	public List<TestConfig> findByQuery(TestConfigQuery query);
 	
 	/**
 	*通过query count总条数
 	*/
 	@SelectProvider(method="countByQuery",type=TestConfigProvider.class)
 	public Integer countByQuery(TestConfigQuery query);
 	
 	/**
 	* 通过ids查询
 	*/
 	@SelectProvider(method="findByIds",type=TestConfigProvider.class)
 	public List<TestConfig> findByIds(List<Integer> ids);
 	
 	@SelectProvider(method="findTestConfigByCategoryIds",type=TestConfigProvider.class)
 	public List<TestConfig> findTestConfigByCategoryIds(List<Integer> ids);
 	

}	